package com.google.code.expr.lang;

/**
 * <p>The root of every component in a parsed expr
 * file.  this includes the components that make
 * up a command, and raw text stream.</p>
 * 
 * @author critchie
 *
 */
public abstract class EXPRAtom {

	public static final String ECHO = "ECHO";
	public static final String SET = "SET";
	public static final String COMMAND_START = "{{";
	public static final String COMMAND_END = "}}";
	public static final String VARIABLE = "$";
	public static final String ASSIGNMENT = "=";
	
	protected int mLineNumber=-1;
	protected int mColumn=-1;

	/**
	 * Sets the location within the full script
	 * of this atom.
	 * 
	 * @param pLineNumber
	 * @param pColumn
	 */
	public void setScriptLocation(int pLineNumber, int pColumn) {
		mLineNumber = pLineNumber;
		mColumn = pColumn;
	}

	/**
	 * Copies the script location from another atom.
	 * @param pAtom
	 */
	public void copyScriptLocation(EXPRAtom pAtom) {
		mLineNumber = pAtom.getLineNumber();
		mColumn = pAtom.getColumn();
	}
	
	/**
	 * @return the line number that this atom starts at within the script
	 */
	public int getLineNumber() {
		return mLineNumber;
	}
	/**
	 * @return the column within the line that this atom starts at within the script
	 */
	public int getColumn() {
		return mColumn;
	}
	
}
